package de.koller.million.render2D.eng;

import de.koller.million.render2D.Render2DStart;
import de.koller.oceanFramework.gl.util.Frame;
import de.koller.oceanFramework.gl.util.ParticleTexture;
import de.koller.oceanFramework.tree.Sea3X;

public class Screen2D extends Sea3X {

	private ParticleTexture screenLayer;
	private ParticleTexture lightLayer;

	@Override
	protected void init() {
		super.init();
		
		screenLayer = ParticleTexture.generate( Render2DStart.WIDTH, Render2DStart.HEIGHT );
		lightLayer  = ParticleTexture.generate( Render2DStart.WIDTH, Render2DStart.HEIGHT );
	}

	public void generateFrame() {
		Frame.save( screenLayer, "./output/base.png", 0, screenLayer.getSize()-Render2DStart.HEIGHT, Render2DStart.WIDTH, Render2DStart.HEIGHT );
		Frame.save( lightLayer, "./output/light.png", 0, screenLayer.getSize()-Render2DStart.HEIGHT, Render2DStart.WIDTH, Render2DStart.HEIGHT );
	}
	
	public ParticleTexture getLightLayer() {
		return lightLayer;
	}

	public ParticleTexture getScreenLayer() {
		return screenLayer;
	}
	
}
